package org.tgcloud.group.repository;

import org.apache.ibatis.annotations.Param;
import org.tgcloud.group.entity.ProjectIntendedMedia;
import org.tgcloud.group.web.controller.dto.project.IntendedMedia.AppIntendedMediaProjectDTO;
import org.tgcloud.group.web.controller.dto.project.IntendedMedia.AppMediaExportDTO;
import org.tgcloud.group.web.controller.dto.project.IntendedMedia.AppMediaListDTO;
import org.tgcloud.group.web.controller.dto.project.IntendedMedia.ProjectIntendedMediaDTO;

import java.util.Date;
import java.util.List;

/**
 * @Author: zhy
 * @Created: 2025-08-27-下午3:09
 * @Description: ${description}
 */
public interface ProjectIntendedMediaMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ProjectIntendedMedia record);

    int insertSelective(ProjectIntendedMedia record);

    ProjectIntendedMedia selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ProjectIntendedMedia record);

    int updateByPrimaryKey(ProjectIntendedMedia record);

    List<ProjectIntendedMediaDTO> selectManageListByKeyword(@Param("projectId") Integer projectId, @Param("status") Short status, @Param("expiredType") Short expiredType,
                                                            @Param("auditStartTime") Date auditStartTime, @Param("auditEndTime") Date auditEndTime,
                                                            @Param("mediumName") String mediumName);

    List<ProjectIntendedMedia> selectListByProjectIdAndMediumIds(@Param("projectId") Integer projectId, @Param("mediumIds") String[] mediumIds);

    int insertBatch(@Param("mediumIds") String[] mediumIds, @Param("projectId") Integer projectId);

    int insertOldMsgBatch(@Param("list") List<ProjectIntendedMedia> mediaList);

    List<AppIntendedMediaProjectDTO> selectAppListByKeyword(@Param("mediumIdList") List<Integer> mediumIdList,
                                                            @Param("status") Integer status, @Param("keyword") String keyword);

    List<AppMediaListDTO> selectAppListByProjectId(@Param("projectId") Integer projectId, @Param("status") Integer status, @Param("mediumIdList") List<Integer> mediumIdList);

    int updateAuditReasonById(@Param("userId") int userId, @Param("projectId") Integer projectId,
            @Param("mediumId") Integer mediumId, @Param("auditReason") String auditReason, @Param("endDate") Date endDate);

    List<ProjectIntendedMedia> selectAppNoAuditListByIds(@Param("ids") String[] ids);

    int updateAcceptById(@Param("userId") int userId, @Param("projectId") Integer projectId, @Param("mediumId") Integer mediumId, @Param("endDate") Date endDate);

    List<AppMediaExportDTO> selectAppListByMediumIdList(@Param("mediumIdList") List<Integer> mediumIdList);
}